package com.xy.hms.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author xiaye
 * @create 2020-05-22-21:30
 */
@Controller
@Api("测试nacos动态刷新配置")
@RefreshScope
@ResponseBody
public class ConfigController {

    @Value("${hms.username}")
    private String testname;

    @Value("${hms.pwd}")
    private String testPwd;

    @GetMapping("/getConfig")
    public String getConfig(){
        return testname+"---"+testPwd;
    }
}
